home *** CD-ROM | disk | FTP | other *** search
- ` -------------------------------------------------------------------------
- ` 5th of November DarkForge Snippet 27/9/2000
- ` -------------------------------------------------------------------------
- ` A quite nice fireworks effect I think! Blurs the smoke trails away,
- ` multiple colours, different amounts of particles.
-
- set display mode 320,240,16
-
- sync rate 0
- sync on
- hide mouse
-
- w=180
- h=120
- xh=h/2
- t=750
-
- create bitmap 2,w,h
-
- dim velocity#(t)
- dim acceleration#(t)
- dim jump(t)
- dim x#(t)
- dim speed#(t)
- dim y#(t)
- dim d(t)
- dim ink(t)
- dim inkcolour(0)
-
- makefire(t,w,h,xh)
-
- inkcolour(0)=1
- start=timer()
-
- do
-
- blur bitmap 2,1
-
- ink rgb(0,0,0),0
- dot 0,0
-
- for a=0 to t
-
- if jump(a)=0
- velocity#(a)=6.0+rnd(5)
- jump(a)=1
- endif
-
- if jump(a)=1
- if velocity#(a)!-8
- velocity#(a)=velocity#(a)-acceleration#(a)
- endif
- y#(a)=y#(a)-velocity#(a)
- endif
-
- temp_x#=x#(a)
- temp_s#=speed#(a)
-
- if y#(a)>h
- y#(a)=h
- else
- if d(a)=1
- inc temp_x#,temp_s#
- else
- dec temp_x#,temp_s#
- endif
- x#(a)=temp_x#
- endif
-
- if inkcolour(0)=1 then ink rgb(ink(a),ink(a),ink(a)),0
- if inkcolour(0)=2 then ink rgb(ink(a),ink(a),90),0
- if inkcolour(0)=3 then ink rgb(ink(a),90,ink(a)),0
- if inkcolour(0)=4 then ink rgb(150,90,ink(a)),0
- if inkcolour(0)=5 then ink rgb(50,200,ink(a)),0
- if inkcolour(0)=6 then ink rgb(150,ink(a),ink(a)/2),0
- if inkcolour(0)=7 then ink rgb(ink(a),50,200),0
- if inkcolour(0)=8 then ink rgb(ink(a)/2,ink(a)/2,ink(a)),0
-
- dot x#(a),y#(a)
-
- next a
-
- copy bitmap 2,0,0,179,119,0,0,0,319,239
-
- sync
-
- if timer()=>start+2500+rnd(1000)
- t=250+rnd(500)
- makefire(t,w,h,xh)
- start=timer()
- inkcolour(0)=rnd(7)+1
- endif
-
- loop
-
- function makefire(t,w,h,xh)
-
- for a=0 to t
-
- velocity#(a)=0
- acceleration#(a)=0.5
- jump(a)=0
- x#(a)=xh+10+rnd(xh/2)
- speed#(a)=rnd(5)
- y#(a)=(h-20)+rnd(20)
- d(a)=rnd(1)
- ink(a)=200+rnd(55)
-
- next a
-
- endfunction
-
-